package com.ler.yrmall.coupon.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ler.yrmall.coupon.mapper.CouponSpuRelationMapper;
import com.ler.yrmall.coupon.entity.CouponSpuRelationEntity;
import com.ler.yrmall.coupon.service.CouponSpuRelationService;
import com.ler.yrmall.coupon.vo.CouponSpuRelationVO;
import com.ler.yrmall.basic.Form;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;


@Service("couponSpuRelationService")
public class CouponSpuRelationServiceImpl extends ServiceImpl<CouponSpuRelationMapper, CouponSpuRelationEntity> implements CouponSpuRelationService {

    @Override
    public IPage<CouponSpuRelationVO> queryPage(Form request) {
        IPage<CouponSpuRelationEntity> page = this.page(request.getPage());
        return page.convert(item -> {
            CouponSpuRelationVO target = new CouponSpuRelationVO();
            BeanUtils.copyProperties(item,target);
            return target;
        });
    }

}